import requests

from common.get_header import get_header


# resp=requests.post(url="http://ihrm2-test.itheima.net/api/company/department",
#               headers={"Authorization":"f5050a1b1a7286536d"},
#               json={"username":"jack123","mobile":"18888888888","workNumber": "666"})
# print(resp.json())

class AddEmp(object):
    def add_emp(self, req_head, req_data):
        resp = requests.post(url="http://ihrm2-test.itheima.net/api/sys/user",
                             headers=req_head, json=req_data)
        return resp


if __name__ == '__main__':
    ihrm = AddEmp()
    req_head = get_header()
    req_body = {
        "username": "jack123",
        "mobile": "18888888888",
        "workNumber": "666"
    }
    resp=ihrm.add_emp(req_head, req_body)
    print(resp.json())
